#include <iostream>
#include <pthread.h>
#include <unistd.h>

pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;


void *threadRoutine(void* args)
{
    std::string name = static_cast<const char*>(args);

    while(true)
    {
        sleep(1);
        pthread_mutex_lock();
    }

}

// 主线程
int main()
{
    pthread_t t1, t2, t3;
    pthread_create(&t1, nullptr, threadRoutine, (void*)"thread-1");
    pthread_create(&t2, nullptr, threadRoutine, (void*)"thread-2");
    pthread_create(&t3, nullptr, threadRoutine, (void*)"thread-3");

    pthread_join(t1, nullptr);
    pthread_join(t2, nullptr);
    pthread_join(t3, nullptr);

    return 0;
}